package Geometry;

import java.util.Scanner;

public class P1084
{	public static void main(String[] args)
	{	Scanner in=new Scanner(System.in);
		int l=in.nextInt(), r=in.nextInt();
		double a=(double)l/2, rs=0;
		if (r<=a) rs=r*r*Math.PI;
		else if (r>=l/Math.sqrt(2.0)) rs=l*l;
		else
		{	double angle=2*Math.acos(a/r);
			double diff=r*r*0.5*angle-0.5*r*r*Math.sin(angle);
			rs=r*r*Math.PI-4*diff;
		}
		System.out.printf("%.3f\n", rs);
		in.close();
	}
}
